﻿//获取class事件
function getByClass(oParent, sClass) {
    var aEle = oParent.getElementsByTagName('*');
    var aResult = [];
    var i = 0;
    for (i = 0; i < aEle.length; i++) {
        if (aEle[i].className == sClass) {
            aResult.push(aEle[i]);
        }
    }
    return aResult;
}

function Saletop() {
    var oDiv = document.getElementById('Saletopid');
    if (oDiv) {
        var oUlbtn = getByClass(oDiv, 'notice_header')[0];
        var aLi = oUlbtn.getElementsByTagName('li');
        var oUlcon = getByClass(oDiv, 'notice_content');
        for (var i = 0; i < aLi.length; i++) {
            aLi[i].index = i;
            aLi[i].onmouseover = function () {
                var iNum = this.index;
                for (var i = 0; i < aLi.length; i++) {
                    aLi[i].className = '';
                    oUlcon[i].style.display = 'none';
                }
                this.className = 'current';
                oUlcon[iNum].style.display = 'block';
            }
        }
    }
}

Saletop();